#include "json_visitor_helper.hpp"
#include "dummy_node.h"

namespace cyclone::parser
{
    Json JsonVisitorHelper::jsonifyRuleNode(DummyNode *node)
    {
        if (auto parent = node->parent)
        {
            auto range = Node::findRuleStartAndEnd(static_cast<ParserRuleContext *>(parent));
            return Node{range.end, range.end, node->type};
        }
        return Node{0, 0, node->type};
    }

} // namespace cyclone::parser
